﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Library.Common;
using Library.Bll;
namespace HanhuaMicroCredit.Admin.Controllers
{
    public class ToolController : UserAuthenController
    {
        //
        // GET: /Tool/

        public ActionResult Index()
        {
            return View("~/Views/Sys/Tool/sql.cshtml");
        }

        [HttpPost]
        public ActionResult SQL(FormCollection fc)
        {
            //string sql = fc["t0_sql"].ToString();
            //if (sql.IndexOf("RHINODB|") >= 0 && sql.IndexOf("|RHINODE") >= 0)
            //{
            //    InsLogBll.InsertLog(User.Identity.Name, "后台工具", "后台执行SQL", sql);
            //    try
            //    {
            //        CommonBLL.ExecuteSQL4NonQuery(sql.Replace("RHINODB|", "").Replace("|RHINODE", "").Trim(), null);
            //        return Content("Success.");
            //    }
            //    catch (Exception e)
            //    {
            //        InsLogBll.InsertLog(User.Identity.Name, "后台工具", "后台执行SQL出错", e.Message);
            //        return Content("Failed.");
            //    }
            //}
            return Content("Illegality");
        }

    }
}
